package acwing._2LanQiao._1Recursion;

import java.util.Scanner;

/**
 * @Project : ProgrammingExercises
 * @Package : ACWing._2LanQiao._1_1Recursion
 * @File : Q0092.java
 * @Author : WangRuoyu
 * @Date : 2023/3/12 17:36
 */

public class Q0092 {
    static int[] state;

    static void f(int m, int n) {
        if (m == n) {
            for (int i = 0; i < n; ++i) {
                if (state[i] == 1) {
                    System.out.print(i + 1 + " ");
                }
            }
            System.out.println();
        } else {
            state[m] = -1;
            f(m + 1, n);
            state[m] = 1;
            f(m + 1, n);
        }
    }

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        state = new int[n];
        f(0, n);
    }
}


